<html>
<head><meta charset="utf-8"><title>showing layout information #75988 · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html">showing layout information #75988</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="231255811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231255811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231255811">(Mar 22 2021 at 02:07)</a>:</h4>
<p>I just noticed <a href="https://github.com/rust-lang/rust/issues/75988">#75988</a> earlier today. The feature suggested is something I've wanted before, so I started looking into it. The implementation is very easy; figuring out the design and placement on the type's page is the tricky part. I've got this so far:</p>
<p><a href="/user_uploads/4715/8g869he7Ql8m45yx1qb1BuUp/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/8g869he7Ql8m45yx1qb1BuUp/image.png" title="image.png"><img src="/user_uploads/4715/8g869he7Ql8m45yx1qb1BuUp/image.png"></a></div><p>However, I don't think we'd want to put layout information at the top of the page since it's auxiliary. I was thinking maybe we could put it at the bottom of the page, but I suspect not many people scroll past auto trait impls etc. But at least the info would be there.</p>
<p>What do you all think?</p>



<a name="231255886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231255886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231255886">(Mar 22 2021 at 02:08)</a>:</h4>
<p>I would put this with the "show declaration" maybe</p>



<a name="231255893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231255893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231255893">(Mar 22 2021 at 02:08)</a>:</h4>
<p>I don't think it needs to be shown by default</p>



<a name="231255918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231255918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231255918">(Mar 22 2021 at 02:08)</a>:</h4>
<p>Yeah, I was thinking about that too, but it's not part of the declaration.</p>



<a name="231255924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231255924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231255924">(Mar 22 2021 at 02:08)</a>:</h4>
<p>although that's going away soon I think <a href="https://github.com/rust-lang/rust/pull/83337">https://github.com/rust-lang/rust/pull/83337</a></p>



<a name="231255936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231255936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231255936">(Mar 22 2021 at 02:09)</a>:</h4>
<p>And the declaration is an abstract form of the code: <a href="/user_uploads/4715/Vahp7oc8dh7uuaRBF_KPT3Qa/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/Vahp7oc8dh7uuaRBF_KPT3Qa/image.png" title="image.png"><img src="/user_uploads/4715/Vahp7oc8dh7uuaRBF_KPT3Qa/image.png"></a></div>



<a name="231260488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231260488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231260488">(Mar 22 2021 at 03:46)</a>:</h4>
<p>Actually I just realized that a type's size is target-specific (e.g. if it contains <code>usize</code> or pointers). Not sure how we should handle that...</p>



<a name="231260502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231260502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231260502">(Mar 22 2021 at 03:46)</a>:</h4>
<p>documentation is already platform-specific, I don't know if we need to handle it specially</p>



<a name="231260504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231260504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231260504">(Mar 22 2021 at 03:46)</a>:</h4>
<p>this is why <a href="http://docs.rs">docs.rs</a> builds for multiple targets</p>



<a name="231261964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/showing%20layout%20information%20%2375988/near/231261964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988.html#231261964">(Mar 22 2021 at 04:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/266220-rustdoc/topic/showing.20layout.20information.20.2375988/near/231260502">said</a>:</p>
<blockquote>
<p>documentation is already platform-specific, I don't know if we need to handle it specially</p>
</blockquote>
<p>I guess it seems like it might be misleading if the docs say a type is a certain size but it's not that size on your target.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>